package com.hk.mini;

import lombok.Data;

/**
 * 状态码
 */
@Data
public class StatusCommond {

    /**
     * mini主机id
     */
    private String miniId;
    /**
     * 分模块/从机id
     */
    private String modAddr;
    /**
     * 模块节数
     */
    private int section;
    /**
     * U位数量
     */
    private int uNum;

    /**
     * U位状态
     */
    private String status;

    public StatusCommond(String code) {
        this.miniId= Long.valueOf(code.substring(14,22),16)+"";
        this.modAddr = String.format("%02d", Integer.valueOf(code.substring(22,24),16));
        this.section = Integer.parseInt(code.substring(28,30),16);
        this.uNum = Integer.parseInt(code.substring(30,32),16);
        this.status=code.substring(68,code.length()-4);
    }
}
